﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using FileDFS.Model;
using System.IO;
using System.Net.Security;
/*
 * Coder:Tieria
 * WriteTime:2015.5.13
 * FileName:IFileService.cs
 * ReMark:分布式文件操作接口
 */
namespace FileDFS.WcfHost
{

    [ServiceContract(SessionMode=SessionMode.NotAllowed)]
    //  [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
    public interface IFileService
    {

        /// <summary>
        /// 检测当前服务是否可用
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string ServerCheck();

        /// <summary>
        /// 上传图片
        /// </summary>
        /// <param name="imageUploadModel"></param>
        /// <returns></returns>
        [OperationContract]
        ImageUploadResult Upload_Image(ImageUploadModel imageUploadModel);

        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="fileUploadModel"></param>
        /// <returns></returns>
        [OperationContract]
        FileUploadResult Upload_File(FileUploadModel fileUploadModel);

        /// <summary>
        /// 下载某张图片的缩略图
        /// </summary>
        /// <param name="tumbnailModel"></param>
        /// <returns></returns>
        [OperationContract]
        ThumbnailDownloadResult Download_ImageThumbnail(ThumbnailDownloadModel downloadModel);

        /// <summary>
        /// 下载文件或者图片
        /// </summary>
        /// <param name="virtualFullPath"></param>
        /// <returns></returns>
        [OperationContract]
        DownloadResult Download_SingleFile(DownloadModel downloadModel);

        /// <summary>
        /// 批量删除文件
        /// </summary>
        /// <param name="deleteList"></param>
        [OperationContract]
        bool Bulk_Delete(List<DeleteModel> deleteList);

        /// <summary>
        /// 获取当前节点的全部的根目录信息
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<FolderInfoModel> GetAllFloders();

        /// <summary>
        /// 获取某个集合列表中文件的大小
        /// </summary>
        /// <param name="virtualPathList"></param>
        /// <returns></returns>
        [OperationContract]
        double GetFilesSize(List<string> virtualPathList);

    }
}
